package com.stn.zjx.givingtreasure.net.impl;

import android.annotation.SuppressLint;
import android.widget.Toast;

import com.lzy.okgo.OkGo;
import com.lzy.okgo.cache.CacheEntity;
import com.lzy.okgo.cache.CacheMode;
import com.lzy.okgo.callback.StringCallback;
import com.stn.zjx.givingtreasure.net.FileApi;
import com.stn.zjx.givingtreasure.net.UserApi;
import com.stn.zjx.givingtreasure.utils.ToolsUtils;
import com.vondear.rxtools.view.RxToast;

import org.json.JSONObject;

import java.io.File;

public class FileNetImpl {



    /**
     * @apiNote 上传文件
     * @param data 数据
     * @param tag 标签
     * @param callback 请求回调
     */
    public static void upload_base64_file(String data,
                                                 String tag, StringCallback callback){
        OkGo.<String>post(FileApi.upload_base64_file)
                .tag(tag)
                .isMultipart(true)
                .upJson(data.toString())
                .execute(callback);

    }



    /**
     * @apiNote 上传文件
     * @param data 数据
     * @param tag 标签
     * @param callback 请求回调
     */
    public static void upload_base64_file_mutiupload(String data,
                                          String tag, StringCallback callback){

        OkGo.<String>post(FileApi.upload_base64_file_mutiupload)
                .tag(tag)
                .upJson(data.toString())
                .execute(callback);

    }
}
